﻿using System;
using System.Numerics;

class CatalanNumber
{
    static void Main()
    {
        Console.WriteLine("Enter a number N to see the Nth Catalan number:");
        BigInteger CatalanNumber = int.Parse(Console.ReadLine());
        BigInteger Factorial1 = 1;
        BigInteger Factorial2 = 1;
        BigInteger Factorial3 = 1;
        for (BigInteger i = 1; i <= 2*CatalanNumber; i++)
        {
            Factorial1 *= i;
        }
        for (BigInteger j = 1; j <= CatalanNumber; j++)
        {
            Factorial2 *= j;
        }
        for (BigInteger n = 1; n <= CatalanNumber + 1; n++)
        {
            Factorial3 *= n;
        }
        Console.WriteLine("The {0} Catalan number is {1}", CatalanNumber, (Factorial1 / (Factorial2 * Factorial3)));
    }
}
